﻿using System;
using System.ComponentModel;
using System.Configuration;
using System.Text.RegularExpressions;

namespace Nana.Web.Compressing
{
  public class CompressionFilterElement
    : RegexElement
  {
    internal CompressionFilterElement() { }

    public CompressionFilterElement(string name, string pattern, RegexOptions flags, Type type)
      : base(name, pattern, flags)
    {
      this.Type = type;
    }

    [ConfigurationProperty("type", IsRequired = true)]
    [TypeConverter(typeof(ModuleTypeConverter))]
    [FactoryTypeValidator]
    public Type Type
    {
      get
      {
        return this.GetConfig(c => c.Type);
      }
      set
      {
        this.SetConfig(c => c.Type, value);
      }
    }


  }
}
